package com.client.autoconfiguration;

import com.client.bean.Instance;
import com.client.task.MyTask;
import com.client.task.TaskManager;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * Description:
 *
 * @author weiruibai.vendor
 * Date: 2023/1/29 16:43
 */
@Configuration
@ConditionalOnBean(EnableEurekaMarkerClient.Marker.class)
public class EurekaClientAutoConfiguration {

    @Bean
    public Instance getInstance() {
        return new Instance();
    }

    @Bean
    public MyTask getMyTask(Instance instance) {
        return new MyTask(instance);
    }

    @Bean
    public TaskManager getTaskManager(MyTask task, Instance instance) {
        return new TaskManager(task, instance);
    }

    @Bean
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
